﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BangleCMS.Model;
using BangleCMS.BLL;

public partial class page : WebPageBase
{
    #region 属性
    private string _pagecode = "";
    public string PageCode
    {
        get
        {
            return Request.QueryString["t"] == null ? "" : Request.QueryString["t"];
        }
    }

    private t_page _model;
    public t_page Model
    {
        get
        {
            return _model;
        }
        set
        {
            _model = value;
        }
    }
    #endregion

    #region 加载
    protected void Page_Load(object sender, EventArgs e)
    {
        getDate(PageCode);
    }
    #endregion

    #region 获得数据
    private void getDate(string pageCode)
    {
        t_pageBLL bll = new t_pageBLL();
        try
        {
            Model = bll.GetModel(pageCode);
        }
        catch (Exception ex)
        {
        }
        if (Model == null)
        {
            Model = new t_page();
            Model.Content = "数据加载错误！";
        }
        else
        {
            bll.Update(Model);
        }
    }
    #endregion
}
